Systems and methods for managing resources in a serverless workload

ABSTRACT

Various approaches for allocating resources to an application having multiple application components, with at least one executing one or more functions, in a serverless service architecture include identifying multiple routing paths, each routing path being associated with a same function service provided by one or more containers or serverless execution entities; determining traffic information on each routing path and/or a cost, a response time and/or a capacity associated with the container or serverless execution entity on each routing path; selecting one of the routing paths and its associated container or serverless execution entity; and causing a computational user of the application to access the container or serverless execution entity on the selected routing path and executing the function(s) thereon.

RELATED APPLICATION

This application is a continuation of U.S. Ser. No. 16/561,263 (filed onSep. 5, 2019), the entire disclosure of which is hereby incorporated byreference.

FIELD OF THE INVENTION

The present invention relates, generally, to a serverless servicearchitecture, and more particularly to systems and methods for managingresources in a serverless workload in the serverless servicearchitecture.

BACKGROUND

Traditional service-oriented computer system architectures may includeone or more dedicated computer servers for each application being run,and are often designed to include an excessive allocation ofresources—for example, physical components such as central processingunits (CPUs) and storage—in order to ensure the ability to handle peakdemands without excessive latency. Such resource overloading can becostly, inefficient and difficult to scale and manage.

So-called “cloud” providers offer various elements of computationalinfrastructure and processing capacity and services (e.g., applications,licenses, etc.) as a service via the internet. The term “cloud” connotesthe arbitrary location of the physical or software resourcescorresponding to the offered services; these are determined by the cloudprovider and may be altered to suit the provider's changing customerdemands and service-level commitments, all in a manner invisible tothose customers.

Cloud computing is a model that enables customers to convenientlyaccess, on demand, a shared pool of configurable computing resources,such as networks, platforms, servers, storage, applications, andservices. These resources can typically be rapidly provisioned and thenreleased with little or no interaction with the service provider using,e.g., automated processes. The customer can be billed based on theactual resource consumption and be freed from the need to own and/ormaintain the corresponding resource infrastructure. As such, cloudcomputing has significantly expanded the class of individuals andcompanies that can be competitive in their respective market segments.

Serverless computing, also known as function-as-a-service (FaaS), is arelatively new cloud-computing paradigm that allows the service providerto dynamically provision, manage and orchestrate resources for anevent-driven function execution. The unit of computation in serverlesscomputing is a function. Unlike virtual machines (VMs) and containers,functions in serverless computing are designed to be launched on demand,upon the arrival of a specific type of a request to the service providerhosting the functions; thus, functions are generally short runningprocesses not requiring continuous server capacity. In addition, thecustomers typically need not specify and configure cloud instances,e.g., VMs and/or containers, to run such functions on. As a result,substantially all of the configuration and dynamic management of theresources becomes the responsibility of the cloud operator. Amazon WebService (AWS) LAMBDA is an exemplary execution entity offeringserverless computing.

Typically, serverless service providers deploy execution entities invarious clusters/regions for launching and executing hosted customerfunctions. As a result, there may be multiple routing paths from thecustomer's region to the serverless execution entities for executing thefunctions. A need thus exists for a resource allocation and managementsystem to select an optimal routing path (e.g., corresponding to aminimal cost) for executing the functions on behalf of customers.

SUMMARY

The present invention relates to approaches for managing and allocatingresources to application functions in a serverless service architecture(e.g., a cloud-based computing system) using a management system. Invarious embodiments, the same or equivalent functions to be executed arecopies and deployed in multiple serverless execution entities orcontainers in various clusters/regions. The management system can thenidentify multiple routing paths from the source region to the availableserverless execution entities/containers capable of executing thefunction. In addition, the management system may acquire trafficinformation on each routing path and/or a characteristic (e.g., thedata-transfer cost, response time or capacity) associated with theserverless execution entity/container on each routing path. Based on theacquired information, the optimal routing path (e.g., corresponding tothe lowest data-transfer cost and/or quickest response time) can beselected to execute the function. In one embodiment, the serverlessexecution entities provide stateless function-execution services; thus,no cost is incurred if the serverless execution entities are notselected to execute the function.

In some embodiments, the management system facilitates trafficengineering for execution of the function by acquiring real-time,updated information about network traffic and/or the characteristicassociated with the serverless execution entities/containers. If theupdated information indicates that another routing path is preferable(e.g., having a lower data-transfer cost or shorter response time) tothe currently selected routing path, the management system may cause thefunction and/or another function in the application to be executed onthe serverless execution entities/containers on the alternative routingpath.

In addition, various embodiments may facilitate traffic engineering forexecution of the function (i) between the containers that areimplemented in the requester's on-premises environment and theserverless execution entities that are implemented in the cloud-basedenvironment or (ii) among the containers and the serverless executionentities that are implemented in the cloud-based environment. Forexample, the management system may acquire information such as the costand/or performance characteristic associated with the containers and/orthe serverless execution entities and/or the traffic information on therouting paths from the source region to the containers and theserverless execution entity. Based on the acquired information, themanagement system may either select the containers or the serverlessexecution entities to execute the function. In addition, the managementsystem may, again, acquire real-time, updated information about thenetwork traffic, cost and/or performance characteristic associated withthe containers and/or the serverless execution entities, and basedthereon determine whether to select a different system and/or adifferent environment to execute the function and/or another function inthe application. These approaches may advantageously relieve overload onthe containers without scaling out the cluster, thereby providing aneconomical solution to overloaded containers.

Further, various embodiments provide approaches to appropriately sizeone or more computational resources allocated to the serverlessexecution entities/containers as well as allocating the best availableresources (e.g., having the lowest prices) with the desired sizes to theserverless execution entities/containers for executing the function. Forexample, the management system may determine and/or monitor the revenueand cost for allocating each of the computational resources to theserverless execution entities/containers, and based thereon, determine asize associated with each of the computational resources. Thus, thisapproach advantageously avoids unnecessary and cumulative costsresulting from oversized resources as well as long response timesresulting from undersized resources. In various embodiments, themanagement system can identify two or more resource providers with thenecessary computational resources to the serverless executionentities/containers. Based on the prices for function execution offeredby the resource providers, the management system may select the bestresource provider and automatically allocate the computationalresources, each having the determined size, from the selected resourceprovider to the serverless execution entities/containers.

Additionally or alternatively, the determined/monitored revenue and/orexpense may be used to (i) scale up or down the serverless executionentities/containers (e.g., by adding or removing computational resourcesto existing components in the serverless execution entities/containers),(ii) scale up the serverless execution entities/containers (e.g., byadding more serverless execution entities/containers), or (iii) suspendor terminate one or more of the serverless executionentities/containers. For example, when the revenue generated by aserverless execution entity/container exceeds the expense associatedtherewith, the management system may automatically scale up theserverless execution entity/container. In one embodiment, a return oninvestment (ROI) is defined as revenue divided by cost. If the ROI islarger than a predetermined threshold, the management system may scaleup the serverless execution entities/containers by adding capacity. Incontrast, when the revenue generated by the serverless executionentity/container is below the expense associated therewith, themanagement system may scale down the serverless executionentities/containers (e.g., by dedicating the associated computationalresources to other tasks). For example, if the ROI is below apredetermined threshold, the management system may suspend or terminatethe serverless execution entity/container.

Accordingly, in one aspect, the invention pertains to a method ofallocating resources to an application including multiple applicationcomponents, with at least one executing one or more functions, in aserverless service architecture. In various embodiments, the methodincludes (a) identifying multiple routing paths, each routing path beingassociated with the same function service provided by one or morecontainers or serverless execution entities; (b) determining trafficinformation on each routing path and/or a cost, a response time and/or acapacity associated with the container(s) or serverless executionentity(entities) on each routing path; (c) selecting one of the routingpaths and its associated container(s) or serverless executionentity(entities) based at least in part on the determination in step(b); and (d) causing a computational user of the application to accessthe container(s) or serverless execution entity(entities) on theselected routing path and executing the function(s) thereon.

The method may further include (e) determining a transfer cost for thecomputational user of the application to access the second container orthe second serverless execution entity on the second routing path,different from the container(s) or serverless execution entity(entities)on the selected routing path, for executing the function(s) thereon; and(f) determining whether to cause the computational user of theapplication to access the second container or the second serverlessexecution entity on the second routing path and execute the function(s)thereon based at least in part on the transfer cost. In addition, themethod may further include causing the computational user of theapplication to access the second container or the second serverlessexecution entity on the second routing path and execute the function(s)thereon in accordance with the determination in step (f).

In some embodiments, the method further includes updating informationabout the traffic information on each routing path and/or the cost,response time and/or capacity associated with the container(s) orserverless execution entity(entities) on each routing path; anddetermining whether to select the second routing path, different fromthe selected routing path, to execute the function(s) based at least inpart on the updated information. In addition, the method may furtherinclude updating information about the traffic information on eachrouting path and/or the cost, response time and/or capacity associatedwith the container(s) or serverless execution entity(entities) on eachrouting path; and based at least in part on the updated information,determining whether to select the second routing path and cause thecontainer(s) or serverless execution entity(entities) associated withthe second routing path, different from the selected routing path, toexecute the second function, different from the function(s) executed instep (d).

The function(s) may include an AWS LAMBDA function, a Google cloudfunction, a Microsoft Azure function, an IBM OpenWhisk function, anOracle Cloud function, and/or a Kubernetes-based Knative function. Inone embodiment, the container(s) or serverless executionentity(entities) are implemented in a cloud-based environment. Inanother embodiment, the container(s) or serverless executionentity(entities) are implemented in an on-premises environment. Inaddition, the traffic information may include a data flow rate, abandwidth and/or a latency on each routing path. In various embodiments,the selected routing path corresponds to a higher data flow rate, abroader bandwidth, a shorter latency, and/or being associated with thecontainer(s) or serverless execution entity(entities) having a lowerdata-transfer cost, a faster response time and/or a larger capacitycompared to unselected routing paths.

In another aspect, the invention relates to a computer system ofallocating resources to an application including multiple applicationcomponents, having at least one executing one or more functions, in aserverless service architecture. In various embodiments, the computersystem includes a management system configured to (a) identify multiplerouting paths, each routing path being associated with the same functionexecuted by one or more containers or serverless execution entities; (b)determine traffic information on each routing path and/or a cost, aresponse time and/or a capacity associated with the container(s) or theserverless execution entity(entities) on each routing path; (c) selectone of the routing paths and its associated container(s) or serverlessexecution entity(entities) based at least in part on the determinationin step (b); and (d) cause a computational user of the application toaccess the container(s) or serverless execution entity(entities) on theselected routing path and execute the function(s) thereon. In oneimplementation, the computer system further includes a processor, astorage I/O resource, a network I/O resource, and I/O pathways.

Another aspect of the invention relates to a method of allocatingresources to an application including multiple application componentsfor executing multiple functions in a serverless service architecture.In various embodiments, the method includes (a) identifying multiplerouting paths, each routing path being associated with one or morecontainers or serverless execution entities; (b) selecting, for each ofthe functions, one of the routing paths and its associated container(s)or serverless execution entity(entities); and (c) causing acomputational user of the application to access the container(s) orserverless execution entity(entities) corresponding to the selectedrouting paths for executing the corresponding functions thereon.

In various embodiments, the method further includes (d) determiningtraffic information on each routing path and/or a cost, a response timeand/or a capacity associated with the container(s) or serverlessexecution entity(entities) on each routing path; the routing paths instep (b) are selected based at least in part on the determination instep (d). In addition, the method may further include (e) updatinginformation about the traffic information on each routing path and/orthe cost, response time and/or capacity associated with the container(s)or serverless execution entity(entities) on each routing path; and (0determining, for each of the functions, whether to select the secondrouting path, different from the corresponding selected routing path instep (b), to execute the corresponding function based at least in parton the updated information. In one embodiment, the method furtherincludes causing the computational user of the application to access thesecond container or second serverless execution entity on the secondrouting path and execute the corresponding function thereon inaccordance with the determination in step (f).

The traffic information may include a data flow rate, a bandwidth and/ora latency on each routing path. In addition, the functions may includeAWS LAMBDA functions, Google cloud functions, Microsoft Azure functions,IBM OpenWhisk functions, Oracle Cloud functions, and/or Kubernetes-basedKnative functions. In one embodiment, the container(s) or serverlessexecution entity(entities) are implemented in a cloud-based environment.In another embodiment, the container(s) or serverless executionentity(entities) are implemented in an on-premises environment.

Still another aspect of the invention relates to a computer system ofallocating resources to an application including multiple applicationcomponents for executing multiple functions in a serverless servicearchitecture. In various embodiments, the computer system includes amanagement system configured to (a) identify multiple routing paths,each routing path being associated with one or more containers orserverless service execution entities; (b) select, for each of thefunctions, one of the routing paths and its associated container(s) orserverless execution entity(entities); and (c) cause a computationaluser of the application to access the container(s) or serverlessexecution entity(entities) corresponding to the selected routing pathsfor executing the corresponding functions thereon. In oneimplementation, the computer system further includes a processor, astorage I/O resource, a network I/O resource, and I/O pathways.

In yet another aspect, a method of allocating resources to anapplication including multiple application components, with at least oneexecuting one or more functions in a serverless service architecture,includes (a) identifying one or more pods having multiple containersorganized as a cluster in a container system capable of executing thefunction(s); (b) identifying one or more routing paths in the serverlessservice architecture, the routing path(s) being associated with one ormore serverless execution entities capable of executing the function(s)thereon; (c) determining (i) traffic information on the routing path(s),(ii) a cost or a performance characteristic associated with a computerresource bundle for the pod(s) and/or (iii) a cost or a performancecharacteristic associated with the serverless executionentity(entities); and (d) based at least in part on the determination instep (c), determining whether to (i) terminate execution of thefunction(s) on the pod(s) and (ii) cause execution of the function(s) onthe serverless execution entity(entities).

The performance characteristic associated with the serverless executionentity(entities) may include a response time and/or a capacity. Inaddition, the computer resource bundle may include a processor, astorage I/O resource, a network I/O resource and I/O pathways connectingthe plurality of containers; the performance characteristic associatedtherewith may include one of a clock rate of the processor, a bandwidthor a latency of the storage I/O resource, a bandwidth or a latency ofthe network I/O resource, and/or a bandwidth or a latency associatedwith the I/O pathways. In one embodiment, the traffic informationincludes a data flow rate, a bandwidth and/or a latency on the at leastone routing path.

The container system may include a Kubernetes container system, and thefunction(s) may include an AWS LAMBDA function, a Google cloud function,a Microsoft Azure function, an IBM OpenWhisk function, an Oracle Cloudfunction, and/or a Kubernates-based Knative function. In one embodiment,the container system and the serverless execution entity(entities) areimplemented in a cloud-based environment. In another embodiment, thecontainer system is implemented in an on-premises environment and theserverless execution entity(entities) is implemented in a cloud-basedenvironment.

In another aspect, the invention relates to a computer system ofallocating resources to an application including multiple applicationcomponents, with at least one executing one or more functions, in aserverless service architecture. In various embodiments, the computersystem includes a management system configured to (a) identify one ormore pods including multiple containers organized as a cluster in acontainer system capable of executing the function(s); (b) identify oneor more routing paths in the serverless service architecture, therouting path(s) being associated with one or more serverless executionentities capable of executing the function(s) thereon; (c) determine (i)traffic information on the routing path(s), (ii) a cost or a performancecharacteristic associated with a computer resource bundle for the pod(s)and/or (iii) a cost or a performance characteristic associated with theserverless execution entity(entities); and (d) based at least in part onthe determination in step (c), determine whether to (i) terminateexecution of the function(s) on the pod(s) and (ii) cause execution ofthe function(s) on the serverless execution entity(entities). In oneimplementation, the computer system further includes a processor, astorage I/O resource, a network I/O resource and I/O pathways. Inaddition, the container system may include a Kubernetes containersystem, and the function(s) may include an AWS LAMBDA function, a Googlecloud function, a Microsoft Azure function, an IBM OpenWhisk function,an Oracle Cloud function, and/or a Kubernates-based Knative function.

In still another aspect, a method of allocating resources to anapplication including multiple application components, with at least oneexecuting one or more functions in a serverless service architecture,includes (a) identifying one or more pods having a cluster of multiplecontainers in a container system capable of executing the function(s);(b) identifying one or more routing paths in a serverless servicearchitecture, the routing path being associated with one or moreserverless execution entities capable of executing the function(s)thereon; (c) determining (i) traffic information on the routing path(s),(ii) a cost or a performance characteristic associated with a computerresource bundle for the pod(s) and/or (iii) a cost or a performancecharacteristic associated with the serverless executionentity(entities); and (d) causing a computational user of theapplication to access the pod(s) or the serverless executionentity(entities) based on the determination in step (c) so as to executethe function(s) thereon.

The performance characteristic associated with the serverless executionentity(entities) may include a response time and/or a capacity. Inaddition, the computer resource bundle may include a processor, astorage I/O resource, a network I/O resource and I/O pathways connectingthe plurality of containers; the performance characteristic associatedtherewith may include a clock rate of the processor, a bandwidth or alatency of the storage I/O resource, a bandwidth or a latency of thenetwork I/O resource, and/or a bandwidth or a latency associated withthe I/O pathways. In some embodiments, the traffic information includesa data flow rate, a bandwidth and/or a latency on the at least onerouting path. The container system may include a Kubernetes containersystem, and the function(s) may include an AWS LAMBDA function, a Googlecloud function, a Microsoft Azure function, an IBM OpenWhisk function,an Oracle Cloud function, and/or a Kubernates-based Knative function. Inone embodiment, the container system and the serverless executionentity(entities) are implemented in a cloud-based environment. Inanother embodiment, the container system is implemented in anon-premises environment and the serverless execution entity(entities) isimplemented in a cloud-based environment.

In another aspect, the invention pertains to a computer system ofallocating resources to an application including multiple applicationcomponents, with at least one executing one or more functions, in aserverless service architecture. In various embodiments, the computersystem including a management system configured to (a) identify one ormore pods having a cluster of multiple containers in a container systemcapable of executing the function(s); (b) identify one or more routingpaths in a serverless service architecture, the routing path(s) beingassociated with one or more serverless execution entities capable ofexecuting the function(s) thereon; (c) determine (i) traffic informationon the routing path(s), (ii) a cost or a performance characteristicassociated with a computer resource bundle for the pod(s), and/or (iii)a cost or a performance characteristic associated with the serverlessexecution entity(entities); and (d) cause a computational user of theapplication to access the pod(s) or the serverless executionentity(entities) based on the determination in step (c) so as to executethe function(s) thereon. In one implementation, the computer systemfurther includes a processor, a storage I/O resource, a network I/Oresource and I/O pathways. In addition, the container system may includea Kubernetes container system, and the function(s) may include an AWSLAMBDA function, a Google cloud function, a Microsoft Azure function, anIBM OpenWhisk function, an Oracle Cloud function, and/or aKubernates-based Knative function.

Another aspect of the invention relates to a method of allocatingresources to an application including multiple application components,with at least one executing one or more functions, in a serverlessservice architecture. In various embodiments, the method includes (a)identifying multiple computational resources associated with one or moreserverless execution entities capable of executing the function(s)thereon; (b) determining a revenue and/or an expense for allocating eachof the computational resources to the serverless executionentity(entities); and (c) based at least in part on the determination instep (b), determining a size associated with each of the computationalresources allocated to the serverless execution entity(entities).

The method may further include causing a computational user of theapplication to access to the serverless execution entity(entities) andexecuting the function(s) thereon. In some embodiments, the revenue isgenerated by causing the function(s) to be executed on the serverlessexecution entity(entities) in response to a request, and the expense isgenerated by allocating the computational resources to the serverlessexecution entity(entities) for executing the function(s). In oneembodiment, the revenue is determined based at least in part on a unitprice associated with each of the computational resources and a quantityof each of the computational resources used to execute the function(s).The method may further include, upon determining that the revenue islarger than the expense, increasing the size associated with one or moreof the computational resources allocated to the serverless executionentity(entities). In addition, the method may further include, upondetermining that the revenue is smaller than the expense, decreasing thesize associated with one or more of the computational resourcesallocated to the serverless execution entity(entities).

The computer resources may include a processor, a storage I/O resource,a network I/O resource and I/O pathways. In addition, the function(s)may include an AWS LAMBDA function, a Google cloud function, a MicrosoftAzure function, an IBM OpenWhisk function, an Oracle Cloud function,and/or a Kubernates-based Knative function. In various embodiments, themethod further includes (e) identifying at least first and secondresource providers for providing the computer resources having thedetermined sizes, each of the resource providers offering a purchaseprice to the serverless execution entity(entities); and (f)automatically allocating the computer resources from the first resourceprovider to the serverless execution entity(entities) based at least inpart on the purchase price offered thereby. In one embodiment, thepurchase price offered by the second resource provider is smaller thanthat offered by the first resource provider.

Still another aspect of the invention relates to a computer system ofallocating resources to an application having multiple applicationcomponents, with at least one executing one or more function, in aserverless service architecture. In various embodiments, the computersystem includes a management system configured to (a) identify multiplecomputational resources associated with one or more serverless executionentities capable of executing the function(s) thereon; (b) determine arevenue and/or an expense for allocating each of the computationalresources to the serverless execution entity(entities); (c) based atleast in part on the determination in step (b), determine a sizeassociated with each of the computational resources allocated to theserverless execution entity(entities); and (d) cause a computationaluser of the application to access to the serverless executionentity(entities) and execute the function(s) thereon.

In yet another aspect, a method of allocating resources to anapplication having multiple application components, with at least oneexecuting one or more functions in a serverless service architecture,includes (a) identifying multiple computational resources associatedwith one or more serverless execution entities capable of executing thefunction(s) on the computational resources; (b) determining a revenueand/or an expense for allocating each of the computational resources tothe serverless execution entity(entities); and (c) based at least inpart on the determined revenue and/or expense, suspending or terminatingexecution of the function(s) on the serverless executionentity(entities) or introducing an additional serverless executionentity in the serverless service architecture.

In one embodiment, the additional serverless execution entity isintroduced upon determining that the revenue is larger than the expense(e.g., the revenue is larger than the expense for a predeterminedfactor). In addition, the revenue and/or the expense may be computedover a predetermined period of time. In some embodiments, execution ofthe function(s) on the serverless execution entity(entities) issuspended or terminated upon determining that the revenue is smallerthan the expense (e.g., the revenue is smaller than the expense for apredetermined factor). In various embodiments, the revenue is generatedby causing the function(s) to be executed on the serverless executionentity(entities) in response to a request, and the expense is generatedby allocating the computational resources to the serverless executionentity(entities) for executing the function(s). The revenue may bedetermined based at least in part on a unit price associated with eachof the computational resources and a quantity of each of thecomputational resources used to execute the function(s).

In various embodiments, the computer resources include a processor, astorage I/O resource, a network I/O resource and I/O pathways. Inaddition, the function(s) may include an AWS LAMBDA function, a Googlecloud function, a Microsoft Azure function, an IBM OpenWhisk function,an Oracle Cloud function, and/or a Kubernates-based Knative function.

Still another aspect of the invention relates to a computer system ofallocating resources to an application including multiple applicationcomponents, with at least one executing one or more functions, in aserverless service architecture. In various embodiments, the computersystem including a management system configured to (a) identify multiplecomputational resources associated with one or more serverless executionentities capable of executing the function(s) on the computationalresources; (b) determine a revenue and/or an expense for allocating eachof the computational resources to the serverless executionentity(entities); and (c) based at least in part on the determinedrevenue and/or expense, suspend or terminate execution of thefunction(s) on the serverless execution entity(entities) or introduce anadditional serverless execution entity in the serverless servicearchitecture. In another aspect, the invention relates to a method ofallocating computer resources to a serverless execution entity capableof executing one or more functions thereon. In various embodiments, themethod includes (a) determining a computer resource bundle to bepurchased for the serverless execution entity to execute thefunction(s); (b) identifying at least first and second resourceproviders for providing the computer resource bundle, each of theresource providers offering a purchase price to the serverless executionentity; and (c) automatically allocating the computer resource bundlefrom the first resource provider to the serverless execution entitybased at least in part on the purchase price offered thereby. In oneimplementation, the purchase price offered by the second resourceprovider is smaller than that offered by the first resource provider.

In one embodiment, the method further includes determining a revenueand/or an expense for allocating the computer resource bundle to theserverless execution entity and based at least in part on the determinedrevenue and/or expense, determining a size associated with the computerresource bundle; the computer resource bundle to be purchased has thedetermined size. The revenue may be generated by causing the function(s)to be executed on the serverless execution entity in response to arequest, and the expense may be generated by allocating the computerresource bundle to the serverless execution entity for executing thefunction(s). In addition, the revenue may be determined based at leastin part on a unit price associated with each resource in the computerresource bundle and a quantity of each resource in the computer resourcebundle used to execute the function(s). In one embodiment, the revenueand/or the expense is computed over a predetermined period of time. Thecomputer resource bundle may include a processor, a storage I/Oresource, a network I/O resource and I/O pathways. In addition, thefunction(s) may include an AWS LAMBDA function, a Google cloud function,a Microsoft Azure function, an IBM OpenWhisk function, an Oracle Cloudfunction, and/or a Kubernates-based Knative function.

In still another aspect, the invention pertains to a computer system ofallocating computer resources to a serverless execution entity capableof executing one or more functions thereon. In various embodiments, thecomputer system including a management system configured to (a)determine a computer resource bundle to be purchased for the serverlessexecution entity to execute the function(s); (b) identify at least firstand second resource providers for providing the computer resourcebundle, each of the resource providers offering a purchase price to theserverless execution entity; and (c) automatically allocate the computerresource bundle from the first resource provider to the serverlessexecution entity based at least in part on the purchase price offeredthereby. In one implementation, the purchase price offered by the firstresource provider is smaller than that offered by the second resourceprovider.

The management system may be further configured to determine a revenueand/or an expense for allocating the computer resource bundle to theserverless execution entity and based at least in part on the determinedrevenue and/or expense, determine a size associated with the computerresource bundle; the computer resource bundle to be purchased has thedetermined size. In various embodiments, the revenue is generated bycausing the function(s) to be executed on the serverless executionentity in response to a request, and the expense is generated byallocating the computer resource bundle to the serverless executionentity for executing the function(s). In addition, the management systemmay be further configured to determine the revenue based at least inpart on a unit price associated with each resource in the computerresource bundle and a quantity of each resource in the computer resourcebundle used to execute the function(s). In one embodiment, the revenueand/or the expense is computed over a predetermined period of time. Thecomputer resource bundle may include a processor, a storage I/Oresource, a network I/O resource and I/O pathways. In addition, thefunction(s) may include an AWS LAMBDA function, a Google cloud function,a Microsoft Azure function, an IBM OpenWhisk function, an Oracle Cloudfunction, and/or a Kubernates-based Knative function.

Reference throughout this specification to “one example,” “an example,”“one embodiment,” or “an embodiment” means that a particular feature,structure, or characteristic described in connection with the example isincluded in at least one example of the present technology. Thus, theoccurrences of the phrases “in one example,” “in an example,” “oneembodiment,” or “an embodiment” in various places throughout thisspecification are not necessarily all referring to the same example.Furthermore, the particular features, structures, routines, steps, orcharacteristics may be combined in any suitable manner in one or moreexamples of the technology. The headings provided herein are forconvenience only and are not intended to limit or interpret the scope ormeaning of the claimed technology.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings, like reference characters generally refer to the sameparts throughout the different views. Also, the drawings are notnecessarily to scale, with an emphasis instead generally being placedupon illustrating the principles of the invention. In the followingdescription, various embodiments of the present invention are describedwith reference to the following drawings, in which:

FIG. 1 schematically depicts an exemplary serverless servicearchitecture in accordance with various embodiments of the currentinvention;

FIG. 2A depicts multiple serverless execution entities employed inmultiple regions/clusters for executing a function in a computingapplication in accordance with various embodiments of the currentinvention;

FIG. 2B schematically depicts a multilayered hierarchical softwareframework for executing a function in a computing application inaccordance with various embodiments of the current invention;

FIG. 2C schematically depicts deployment of equivalent functions, via agateway, in multiple serverless execution entities that are located indifferent clusters/regions in accordance with various embodiments of thecurrent invention;

FIG. 3 is a block diagram of an example container environment inaccordance with various embodiments of the current invention;

FIG. 4 is a flow chart illustrating an approach for allocating resourcesto an application having multiple application components for executingone or more computing functions in accordance with various embodimentsof the present invention;

FIGS. 5A and 5B depict an on-premises environment and a cloud-basedenvironment for executing a function in a computing application inaccordance with various embodiments of the current invention;

FIG. 5C schematically depicts implementation of Istio and a functiongateway to provide a per-client route control and/or load distributionin accordance with various embodiments of the current invention;

FIG. 6 is a flow chart illustrating an approach for facilitating trafficengineering for execution of a function in a computing applicationbetween an on-premises environment and a cloud-based environment orbetween a container system and a serverless service system both in thecloud-based environment in accordance with various embodiments of thepresent invention;

FIG. 7 is a flow chart illustrating an approach for determining sizesassociated with computational resources and allocating the bestavailable resources having the determined sizes to a serverlessexecution entity and/or pod for executing a computing function inaccordance with various embodiments in accordance with variousembodiments of the present invention;

FIG. 8 is a flow chart illustrating an approach for scaling up, down orout and/or suspending or terminating the serverless executionentity/container executing a function in a computing application inaccordance with various embodiments.

DETAILED DESCRIPTION

FIG. 1 schematically shows an exemplary service system 100 including aservice provider (e.g., a cloud-computing service provider) 102 forproviding an infrastructure platform upon which a cloud environment canbe supported. In one embodiment, the system 100 is designed andconfigured for serverless computing and employs a correspondingserverless platform, serverless cloud infrastructure, etc. Theserverless platform may include one or more serverless executionentities 104 (e.g., instances, virtual machines, containers and/orphysical computers), a datastore 106, and hardware resources 108configured to control and support operations of the serverless executionentities 104 in the cloud environment. In one embodiment, the serverlessexecution entities 104 provide stateless function-execution services;thus, no charge is required if the serverless execution entities 104 arenot used. The serverless platform may include AWS LAMBDA, GOOGLE CLOUDFunction, MICROSOFT AZURE Function, IBM OPENWHISK, ORACLE CLOUD and/orKubernetes-based KNATIVE platform. As used herein, the term “serverless”refers to a relatively high level of abstraction in cloud computing. Theuse of this term should not be construed to mean that there are noservers in the corresponding system, but rather that the underlyinginfrastructure platform (including physical and virtual hosts, virtualmachines, instances, containers, etc.) as well as the operating system,is abstracted away from (i.e., not visible to) the user/developer. Forexample, in serverless computing, applications can be run in statelesscomputing containers that may be event-triggered. Users/developers cancreate functions and then rely on the serverless cloud infrastructureand/or a management system 120 to allocate proper resources to executethe function as further described below.

In various embodiments, the management system 120 is configured toenable users to use one or more service providers 102 to develop anddeploy a computing application via user devices and/or terminals 122.The management system 120 may create, develop, troubleshoot, and/orupload the computing application to the infrastructure platform providedby the serverless service provider 102 using, for example, a terminaland/or workstation 124 at the system side and an interface or gateway126 designated as the frontend at the service-provider side. In atypical service management, the management system 120 is a customer ofthe service provider 102, whereas the users represented by terminals 122are customers of the management system 120. At the same time, terminals122 are clients of the cloud environment.

The management system 120 may also include an automated administrativeentity 128 for managing and supporting execution of the computingapplication. In one embodiment, the administrative entity 128 includes anetworked computer 130 having a central processing unit (CPU) 132, amemory 134 (which can be implemented as any type of volatile memory,such as SDRAM, or non-volatile, such as Flash memory), a storage device136 (such as a magnetic, solid-state, or flash disk), and one or moreinput/output (I/O) components (e.g., a network I/O resource, I/Opathways, etc.) 138. The CPU 132 may be configurable to host one or morevirtual machines and/or run various processes corresponding to manageand support execution of the computing application as further describedbelow. In addition, the CPU 132 may provide various computationalfunctions described below through software, hardware, firmware,hardwiring, or any combination thereof. For example, the CPU 132 mayinclude a general-purpose or special-purpose digital data processorprogrammed with software in a conventional manner. Memory 134 maytemporarily store transitory information and allow the CPU 132 toquickly access the stored information. The storage device 136 may storemore-permanent information in a non-volatile manner. For example, one ormore storage devices 136 may be used to implement a datastore 116storing, for example, a database of service-level agreements (SLAs)between the proprietor of the management system 120 and the users. TheI/O components 138 may be connected to system interfaces. All of theseelements in the computer 130 are interconnected using an internal bus140. In addition, the computer 130 may include one or more externallinks 142 for connecting the computer 130 to elements in theinfrastructure platform of the service provider 102 and/or the userdevices/terminals 122.

The memory 134 may include instructions for low-level operation of thecomputer 130, such as operating-system instructions,device-driver-interface instructions, or any other type of suchinstructions. The operating system is not limited to any particulartype; rather, any operating system (such as WINDOWS, LINUX, or OSX)and/or other instructions are within the scope of the present invention.As further described below, the memory 134 may include an operatingsystem 144 for directing the execution of low-level, basic systemfunctions such as memory allocation, file management and operation ofthe main memory 134 and/or storage device 136. In addition, the memory134 may include instructions, such as a path-identifying module 146 foridentifying multiple routing paths, each associated with a serverlessexecution entity and/or a container (or a cluster of containers) forexecuting a function in a computing application, and deployingequivalent functions onto the serverless execution entities located onthe routing paths, an information-acquisition module 148 for acquiringand/or determining traffic information on each of the routing pathsand/or a characteristic (e.g., a cost, a response time and/or acapacity) associated with the serverless execution entity/container oneach of the routing paths, a path-selection module 150 for selecting theoptimal routing path and its associated serverless executionentity/container to execute the computing function based on thedetermined traffic information and/or the characteristic of theserverless execution entity/container, a recommendation module 152 forrecommending the selected routing path to the computing function and/orcausing the computing function to be executed on the correspondingserverless execution entity/container on the selected routing path, arevenue and expense monitoring module 154 for determining the revenueand/or expense for allocating one or more computational resources to theserverless execution entity/container, a function-sizing module 156 fordetermining a size associated with one of the computational resourcesallocated to the serverless execution entity/container for executing thecomputing function, a resource-allocation module 158 for allocating theoptimal resources having the determined sizes to the serverlessexecution entity/container, and a resource-scaling module 160 forscaling up, down or out and/or terminate the serverless executionentity/container.

In operation, a computing application may be first deployed in acloud-based environment by the user and/or the management system 120 viathe terminal 124 and/or interface 126; optionally, the application maybe stored in the memory 134, storage device 136 and/or anymemory/storage device associated with the service provider 102. In oneembodiment, the application includes multiple application components forexecuting one or more computing functions. An example of the applicationmay be a NETFLIX transaction-processing application; one function of thetransaction application may be a recommendation generator that gives thecustomer recommendations for additional movies. The management system120 may delegate execution of the function(s) to one or more serverlessexecution entities 104 and/or containers and/or manage the functionexecution in the cloud-based or on-premises environment as furtherdescribed below. Function execution may be triggered by, for example, auser request and/or other relevant events, such as changes to thepertinent data saved in memory 134.

The serverless execution entities 104 may be employed at multipleregions/clusters in the cloud-based environment. For example, referringto FIG. 2A, a serverless execution entity 202 and a serverless executionentity 204 may be employed in the Asia-Pacific (AP) southeast region andthe U.S. east region, respectively. Because the source region (i.e., therequesting computing application 206) is located in the AP southeastregion and the datastore and/or service 208 required for executing therequested function is located in the U.S. east region, two routing paths210, 212 may exist for obtaining function execution. For the routingpath 210, no data-transfer cost is required for the entity requestingthe computing function to access the serverless execution entity 202(because they are located in the same region), but there is adata-transfer cost for the serverless execution entity 202 to access thedatastore 208 (because they are located in different regions). Incontrast, for the routing path 212, there is a data-transfer cost forthe computing function to access the serverless execution entity 204,but it is free for the serverless execution entity 204 to access thedatastore 208. FIG. 2B schematically depicts a multilayered hierarchicalsoftware framework 220 for executing one or more functions in thecomputing application. The framework 220 may include a first layer 222that implements infrastructure as a service (IaaS), a second layer 224that implements a platform as a service (Paas) and/or containers as aservice (CaaS), and a third layer 226 that implements a function as aservice (FaaS). Again, the same function service provided by twoserverless execution entities 202, 204 on the FaaS layer may be used toexecute a function in the computing application 206.

To determine which routing path and its associated serverless executionentity for executing the computing function, it may be necessary toacquire information about traffic that represents the volumes and typesof network traffic on each routing path. The traffic information may bemeasured using any suitable hardware and/or software tools. For example,the traffic may be computed using a network protocol, such as NetFlow orISTIO. In addition, the management system 120 (e.g., theinformation-acquisition module 148) may acquire information about acharacteristic (e.g., a cost, a response time and/or a capacity)associated with the serverless execution entity on each routing path.For example, the management system may receive the cost information andresponse time from the cloud provider and ISTIO, respectively.Additionally or alternatively, the management system 120 may analyze ahistorical trend of the value associated with the characteristic and,based thereon, determine or predict the current value associated withthe characteristic. In one embodiment, the current characteristic valueis determined based on the last sampled value in the historical trend.Based on the acquired traffic information on each routing path and/orthe characteristic associated with the serverless execution entity oneach routing path, the management system 120 (e.g., the path-selectionmodule 150) may then select the optimal routing path to execute thefunction. For example, the selected routing path may have a higher dataflow rate, a broader bandwidth, a shorter latency, and/or include aserverless execution entity 104 that has a lower data-transfer cost foraccessing the datastore 208 and/or allowing the computing function toaccess thereto, a faster response time and/or a larger capacity. Uponselection of the routing path, the management system 120 (e.g., therecommendation module 152) may then cause the computing functionrequester to access the serverless execution entity on the selectedrouting path so as to execute the function uploaded and stored in thememory 134 and/or storage device 136. Alternatively, the managementsystem 120 (e.g., the recommendation module 152) may transmit thecomputing function stored in the memory 134 and/or storage device 136 tothe serverless execution entity on the selected routing path so as toobtain execution thereof.

In various embodiments, the user and/or the management system 120 (e.g.,the path-identifying module 146), upon identifying different routingpaths, deploys equivalent functions onto the serverless executionentities located on the routing paths in order to facilitate trafficengineering. This does not result in a financial burden on the userbecause, again, the serverless execution entities may provide statelessfunction-execution services, and no resources are expended if theserverless execution entities 104 are not used. Referring to FIG. 2C,assuming the serverless execution entity 202 is located in the sourceregion (i.e., the location of the computing function 206) as depicted,the management system 120 (e.g., the path-identifying module 146) maycopy and deploy the function to be executed on the serverless executionentity 204 located in the destination region (e.g., the location of thedatastore 208). The user and/or the management system 120 may thenaccess the serverless execution entities 202, 204 via a gateway forreconfiguring the routing path for executing the function as furtherdescribed below. For example, a function service provided by the AWSLAMBDA platform can be accessed via an API Gateway in the source regionto execute “per-function” traffic rerouting.

To facilitate traffic engineering, the management system 120 (e.g., theinformation-acquisition module 148) may acquire real-time updatedinformation about the traffic information on each of the routing paths210, 212 and/or the characteristic (e.g., the cost, response time and/orcapacity) associated with the serverless execution entities 202, 204 onthe routing paths 210, 212. For example, assuming that the computingfunction in the application 206 is executed using the serverlessexecution entity 202 on the routing path 210, if the updated informationindicates that the traffic information on the routing path 212 is better(e.g., having a higher data flow rate, a broader bandwidth and/or ashorter latency), the data-transfer cost for the computing function toaccess the serverless execution entity 204 on the routing path 212 islower than the data-transfer cost for the serverless execution entity202 on the routing path 210 to access the datastore 208, and/or theserverless execution entity 204 has a faster response time and/or alarger capacity, the management system 120 (e.g., the recommendationmodule 152) may recommend/cause the function in the application 206 tobe transferred to and executed by the serverless execution entity 204 onthe routing path 212, instead. In some embodiments, upon determiningthat the routing path 212 is a better choice, the management system 120may wait until the computing function is fully executed beforerecommending/causing a second function in the application to be executedby the serverless execution entity 204 on the rerouting path 212.

Typically, the serverless execution entities 202, 204 include multiplecommon computational resources or commodities for executing thecomputing function. In one embodiment, one of the common commodities isa commodity-accessing key; this ensures that the computing function canbe placed and executed by the correct function service having the sameaccess key on the serverless execution entities 202, 204. In addition,if the serverless execution entity on the rerouting path does notinclude the required serverless service function (e.g., AWS LAMBDA) forexecuting the computing function, the management system 120 may copy anddeploy the necessary serverless service function in the serverlessexecution entity 204 on the rerouting path for ensuring facilitation oftraffic engineering. It should be noted that the serverless platformproviding the serverless execution entity on each routing path may bethe same or different. For example, the serverless execution entities202, 204 may be both provided by AWS LAMBDA; alternatively, theserverless execution entity 202 may be provided by AWS LAMBDA, where theserverless execution entity 204 may be provided by MICROSOFT AZUREFunction. Further, although the above descriptions consider acloud-based environment, it will be understood that the principlesdescribed herein may also be applied to an on-premises environment. Forexample, the serverless service provider 102 depicted in FIG. 1 mayinclude on-premises resources (e.g., VMs) for executing the function(s)in a computing application.

In various embodiments, each routing path is associated with one or morecontainers in a container system for executing the function in thecomputing application; the containers may be in the cloud-basedenvironment or in the on-premises environment. Container systems providean operating-system level virtualization in which the kernel of anoperating system can support multiple isolated user-space instances.Stated another way, a container is based on server virtualization thatuses a shared operating system. Rather than virtualizing hardware andcreating entire virtual machines, each with its own operating system,containers run atop the shared operating system kernel and file system.Like shipping containers for cargo, these software containers can shipapplications (and their associated functions) across differentnetwork-based systems (e.g., cloud computing based systems) and limitthe impact of one container's activities on another container.

A container system may include software abstractions to virtualizecomputer resources (or compute resources) which are used by applicationsrunning in the container (“containerized” applications). The containersystem provides means to provision containers, allocate and control theresources available to a container, deploy and execute applications inthe container, and facilitate full use of the container resources bysuch containerized applications, while isolating them from otherapplications, sharing the underlying resources. When a containerizedapplication accesses a virtualized container resource (e.g., CPU,memory, storage I/O, Network I/O), the container system maps this accessto a direct access of the underlying real resource.

FIG. 3 illustrates a representative container system 300 in accordancewith various embodiments. The system 300 includes two servers 302, 304that run respective container systems 310, 312. The container system310, at the server 302, allocates computer resources (or computeresources) of the server 302—e.g., CPUs, memories, storage volume,storage, and/or network I/O pathways and bandwidth—to two containers320, 322. Similarly, the container system 312 at the server 304allocates resources of the server 304 to containers 324, 326. Thecontainers 320, 322, 324, 326 execute respective containerizedapplications 330, 332, 334, 336.

As previously discussed, container systems permit flexible organization.In the example system 300, the servers 302, 304 may be physical machineswith physical computer (or computational) resources. Alternatively, theserver 302 may be a virtual machine with virtualized resources while theserver 304 is a physical server. The containers 320, 322, 324, 326 maybe distinct containers, or replicated copies of a single container. Insome embodiments, a group of containers may be clustered into acontainer-Point-of-Delivery (cPOD) system, to run related applications.The I/O pathway between the applications 330, 334 traverses theapplication 330, the container 320, the container system 310, anoperating system 306, a network interface card (NIC) 340, a data network360, a NIC 342, an operating system 308, the container system 312, thecontainer 324, and the application 334. Further details of the containersystem and approaches for managing resources therein are provided, forexample, in U.S. Pat. No. 10,346,775, the entire disclosure of which ishereby incorporated herein by reference.

In various embodiments, the containers 330-336 are located in differentclusters/regions, and the computing function in the application 206 canbe executed by any one of the containers 330-336. The management system120 described above may then be implemented to select the optimalrouting path and cause the computing function to be executed by thecontainer on the selected routing path using the approaches describedabove.

FIG. 4 is a flow chart illustrating an exemplary procedure 400 forallocating resources to an application having multiple applicationcomponents for executing one or more functions that have been uploadedto a serverless service provider 102 or a container provider via, forexample, the terminal 124 and/or interface 126. Optionally, the uploadedfunction may be stored in memory associated with the management system120 and/or serverless service provider 102 (or a storage I/O resourceassociated with the container provider). In a first step 402, themanagement system 120 (e.g., the path-identifying module 146) mayidentify multiple routing paths, each associated with a serverlessexecution entity (or a container) for executing a function in theapplication. In a second step 404, the management system 120 (e.g., theinformation-acquisition module 148) may determine traffic information oneach routing path and/or a characteristic (e.g., a data-transfer cost, aresponse time and/or a capacity) associated with the serverlessexecution entity (or container) on each routing path. In a third step406, the management system 120 (e.g., the path-selection module 150) mayselect one of the routing paths and its associated serverless executionentity or container based at least in part on the determined trafficinformation and/or characteristic of the serverless execution entity (orcontainer) on each routing path. In a fourth step 408, the managementsystem 120 (e.g., the recommendation module 152) may cause the computingfunction requester to access the serverless execution entity (orcontainer) on the selected routing path and execute the functionthereon. In various embodiments, while the function is executed by theserverless execution entity (or container) on the selected routing path,the management system 120 (e.g., the information-acquisition module 148)may acquire real-time updated information about the traffic informationon each of the routing paths and/or the characteristic of the serverlessexecution entities (or containers) on the routing paths (step 410).Based at least in part on the updated information, the management system120 (e.g., the path-selection module 150) may determine whether toselect a different serverless execution entity (or container) on adifferent routing path to execute the computing function and/or a secondcomputing function of the application (step 412). When a differentserverless execution entity (or container) is selected, the managementsystem 120 (e.g., the recommendation module 152) may cause the computingfunction requester and/or a second function, different from thecomputing function in the application, to access the newly selectedserverless execution entity (or container) on the newly selected routingpath and execute the function thereon (step 414).

In some embodiments, the application includes multiple functions. Steps402-414 may be implemented to simultaneously or subsequently select thebest routing paths for the functions and/or cause the functions to besimultaneously or subsequently executed on the serverless executionentities (or containers) corresponding to the selected routing paths.

In various embodiments, the management system 120 may facilitate trafficengineering for execution of a computing function between an on-premisesenvironment and a cloud-based environment. For example, referring toFIGS. 5A and 5B, a computing function 502 in an application may beexecuted by a function service 504 provided by a container or a clusterof containers (e.g., a pod) in the on-premises environment 506 or afunction service 508 (which may be the same as service 504) provided bya serverless execution entity (or a cloud-based container or pod) in thecloud-based environment 510. For ease of reference, the followingdescription refers to using the function service provided by a pod toexecute the computing function 502 in the on-premises environment; itshould be understood, however, that a single container may suffice toprovide the function service for executing the computing function 502 aswell. The pod may include a computer resource bundle having, forexample, a processor, a storage I/O resource, a network I/O resource andI/O pathways connecting the containers as further described below. Inaddition, the following description refers to using the function serviceprovided by a serverless execution entity (e.g., AWS LAMBDA) to executethe computing function in the cloud-based environment; it should beunderstood, however, that a cloud-based container or pod may alsoprovide the functionality for executing the computing function in thecloud-based environment as well.

To determine which environment is used for executing the computingfunction 502, in various embodiments, the management system 120 (e.g.,the information-acquisition module 148) may acquire a cost and/or aperformance characteristic (e.g., a clock rate of the processor, abandwidth or a latency of the storage I/O resource, a bandwidth or alatency of the network I/O resource, or a bandwidth or a latencyassociated with the I/O pathways) associated with the computer resourcebundle for the pod in the on-premises environment 508 and a cost (e.g.,the data-transfer cost for the computing function 502 to access theserverless execution entity located in a different region/cluster)and/or a performance characteristic (e.g., a response time and/or acapacity) associated with the serverless execution entity in thecloud-based environment 510. Optionally, the management system 120(e.g., the information-acquisition module 148) may also acquire trafficinformation on the routing path from the source region (i.e., where thecomputing function 502 is located) to the serverless execution entityoffering the function service 508 in the cloud-based environment 510.Based on the acquired costs and/or performance characteristicsassociated with the pod and the serverless execution entity as well asthe traffic information, the management system 120 (e.g., thepath-selection module 150) may then select the pod in the on-premisesenvironment 506 or the serverless execution entity in the cloud-basedenvironment 510 to execute the function. For example, when the costassociated with the computer resource bundle for the pod is lower thanthe data-transfer cost associated with the serverless execution entityand/or the performance characteristic associated with the pod issatisfactory (e.g., a high processor clock rate, broad bandwidth orshort latency of the storage I/O resource, broad bandwidth or shortlatency of the network I/O resource, or broad bandwidth or short latencyassociated with the I/O pathways), the management system 120 (e.g., therecommendation module 152) may recommend that the function 502 requesteruse the function service 504 provided by the pod in the on-premisesenvironment 506 to execute the function 502. Conversely, when thedata-transfer cost associated with the serverless execution entity inthe cloud-based environment 510 is lower than the cost associated withthe computer resource bundle for the pod in the on-premises environment506 and/or the performance characteristic associated with the serverlessexecution entity is satisfactory (e.g., a short response time and/or alarge capacity), the management system 120 (e.g., the recommendationmodule 152) may recommend and cause the computing function 502 to beexecuted by the function service 508 provided by the serverlessexecution entity in the cloud-based environment 510.

The management system 120 may be further configured to facilitatetraffic engineering for execution of the computing function 502 (and/ora different computing function in the application) between theon-premises environment 508 and the cloud-based environment 510. In oneembodiment, the management system 120 (e.g., the information-acquisitionmodule 148) acquires real-time information about the cost and/orperformance characteristic associated with the pod and the serverlessexecution entity in the on-premises environment 506 and cloud-basedenvironment 510, respectively, and/or the traffic information on therouting path from the computing function 502 to the serverless executionentity in the cloud-based environment 510. Assuming that the computingfunction 502 is executed using the serverless execution entity in thecloud-based environment 510, the management system 120 mayrecommend/cause the function to be transferred to the pod in theon-premises environment 506 and execute the function therein if theacquired real-time information indicates that the traffic information onthe routing path from the source region to the serverless executionentity in the cloud-based environment 510 is unsatisfactory (e.g.,having a low data flow rate, a narrow bandwidth and/or a long latency),the data-transfer cost associated with the serverless execution entityin the cloud-based environment 510 is higher than the cost associatedwith the pod in the on-premises environment 508 and/or the performanceassociated with the pod is improved (e.g., a processor with a higherclock rate, broader bandwidth or shorter latency of the storage I/Oresource, broader bandwidth or shorter latency of the network I/Oresource, or broader bandwidth or shorter latency associated with theI/O pathways). Similarly, the management system 120 may cause thefunction that is currently executed on the pod in the on-premisesenvironment 506 to be transferred to the serverless execution entity inthe cloud-based environment 510 and executed thereon if the acquiredreal-time information indicates that a lower cost and/or betterperformance can be achieved in the cloud-based environment 510. In someembodiments, upon determining that another environment, different fromthe current environment in which the function is executed, has a lowercost and/or better performance for executing the computing function 502,the management system 120 (e.g., the recommendation module 152) may waituntil the current computing function 502 is fully executed beforerecommending or causing a second function, different from the currentcomputing function 502, in the application to be executed in the newlydetermined environment.

In some embodiments, the containers and pods in the container system areemployed in a cloud-based environment. For example, the container systemmay include a Kubernetes (k8s) cluster maintained by the Cloud NativeComputing Foundation. The approaches described above for facilitatingtraffic engineering between the on-premises environment 506 and thecloud-based environment 510 may be implemented to facilitate trafficengineering between the Kubernetes cluster in the cloud-basedenvironment and the serverless execution entity (e.g., AWS LAMBDA) inthe cloud-based environment.

Referring to FIG. 5C, in various embodiments, the management system 120may utilize a combination of ISTIO and an API gateway (such as Kong) toprovide “per-client” route control and/or load distribution. This mayadvantageously reduce the complexity and required time for facilitatingtraffic engineering for execution of multiple functions deployed by thesame client.

FIG. 6 is a flow chart illustrating a procedure 600 for facilitatingtraffic engineering for determining whether to execute a computingfunction in an on-premises environment or a cloud-based environment, oron a container system or a serverless service system (both in thecloud-based environment) in accordance with various embodiments. In afirst step 602, the user and/or the management system 120 (e.g., thepath-identifying module 146) may identify at least a container or a podincluding a cluster of containers in a container system capable ofexecuting the computing function in the on-premises environment or inthe cloud-based environment. In a second step 604, the management system120 (e.g., the path-identifying module 146) may identify at least onerouting path associated with a serverless execution entity in thecloud-based environment for executing the function thereon. In a thirdstep 606, the management system 120 (e.g., the information-acquisitionmodule 148) may acquire information such as the cost and/or performancecharacteristic associated with the pod and/or the serverless executionentity, and/or traffic information on the routing paths from thecomputing function to the pod and to the serverless execution entity. Ina fourth step 608, the management system 120 (e.g., the path-selectionmodule 150) may select either the pod identified in step 602 or theserverless execution entity identified in step 604 for executing thecomputing function. The selection may be determined based on theinformation acquired in step 606. In a fifth step 610, the managementsystem 120 (e.g., the recommendation module 152) may cause the computingfunction requester to access the selected serverless execution entity inthe cloud-based environment or the pod in the on-premises environment(or, in some embodiments, in the cloud-based environment) to execute thefunction thereon. In various embodiments, while the function is executedby the selected pod or the serverless execution entity, the managementsystem 120 (e.g., the information-acquisition module 148) may acquirereal-time updated information about the cost and/or performancecharacteristic associated with the pod and/or the serverless executionentity and/or the traffic information on the routing paths from thecomputing function to pod and/or the serverless execution entity (step612). Based at least in part on the updated information, the managementsystem 120 (e.g., the path-selection module 150) may determine whetherto select a different system (e.g., the container or the serverlessexecution entity) and/or a different environment (e.g., the on-premisesenvironment or the cloud-based environment) to execute the computingfunction and/or a second computing function, different from thecurrently executed function, in the application (step 614). When adifferent system and/or environment is selected, the management system120 (e.g., the recommendation module 152) may cause the computingfunction requester and/or the second function to access the functionservice in the newly selected system and/or environment and execute thefunction therein (step 616).

The approaches described above for routing traffic (i) from a serverlessexecution entity to a different serverless execution entity in thecloud-based environment, (ii) from a container/pod to a differentcontainer/pod in the on-premises or cloud-based environment, (iii) froma container/pod in the on-premises environment to a serverless executionentity in the cloud-based environment and/or (iv) from a container/podin the cloud-based environment to a serverless execution entity in thecloud-based environment may be implemented to advantageously relieve theburden on an overloaded container/pod or a serverless execution entity.In contrast to the conventional approach where more containers/pods areadded to scale up the cluster when the cluster is overloaded, thetraffic-engineering approaches described above may provide aless-expensive solution.

In various embodiments, the management system 120 (e.g., the revenue andexpense monitoring module 154) identifies one or more computationalresources (e.g., a processor, a memory, a storage I/O resource, anetwork I/O resource and I/O pathways) associated with the serverlessexecution entity and/or pod for executing one or more functions thereon.In addition, the revenue and expense monitoring module 154 may maintainfull accounting of revenues and costs for allocating the computationalresource(s) and provides monitoring of these accounts and notificationsupon certain accounting events. The revenue and expense monitoringmodule 154, by itself or with the assistance of an incorporated orseparate return-on-investment (ROI) module (not shown), enables a userto monitor the ROI of the computational resource(s). The ROI is definedas revenue divided by cost, where revenue is the income from real and/orvirtual payment collected by the consumer(s). Cost may be assigned inany suitable fashion; for example, the cost may be the out-of-pocketexpense of using an external resource, or the fully loaded, attributedinternal cost of using an on-premises resource. The cost may be measuredin real currency (for out-of-pocket expenses) or virtual currency (forattributed internal costs). The revenue and expense monitoring module154 may compute the revenue from each computational resource based on aunit price thereof and the quantity of the resource used by the consumerto execute a computing function. For example, suppose an ecommerceapplication capable of processing 100 transactions per second has acurrent utilization rate of 50%; in this case, the unit price may be setbased on the 50% utilization or 50 transactions per second, and therequester may be charged this price times the number of transactionsexecuted. Similarly, as noted above, the cost may include the amountsactually paid for the serverless execution entity/container to executethe computing function as well as the attributed cost including overheadof support by on on-premises equipment. The revenue and/or expense maybe computed over a predetermined period of time (e.g., ten hours, tendays, one month, etc.). Further details about approaches to determiningand monitoring the revenue and/or expense are provided, for example, inU.S. Pat. No. 10,346,775, the entire disclosure of which is herebyincorporated herein by reference.

In various embodiments, based on the monitored revenue and/or expense,the management system 120 (e.g., the function-sizing module 156) maydetermine the size associated with each of the computational resourcesallocated to the serverless execution entity/container for executing thecomputing function. For example, when the revenue and expense monitoringmodule 154 determines that the revenue (real and/or attributable) islarger than the expense (also real and/or attributable) for apredetermined factor (e.g., twice, five times or ten times), thefunction-sizing module 156 may increase the size associated with one ormore computational resources allocated to the serverless executionentity/container in relation to the excess of revenue over expenses.Conversely, when the revenue and expense monitoring module 154determines that the revenue is smaller than the expense for apredetermined factor (e.g., twice, five times or ten times), thefunction-sizing module 156 may decrease the size associated with one ormore computational resources allocated to the serverless executionentity/container, e.g., by re-allocating those resources to performother tasks (or, eventually, even decommissioning hardware).

In some embodiments, once the size associated with each computationalresource allocated to the serverless execution entity/container forexecuting the computing function is determined, the management system(e.g., the resource-allocation module 158) may allocate the optimalavailable computational resources having the determined sizes to theserverless execution entity/container. For example, theresource-allocation module 158 may identify two or more resourceproviders for providing the necessary computational resources with thedetermined sizes to the serverless execution entity/container forexecuting the computing function; each of the resource providers mayoffer a purchase price. Based on the offered price, theresource-allocation module 158 may select the lowest price andautomatically allocate the computer resources from the resource provideroffering the lowest price to the serverless execution entity/container.In various embodiments, the resource-allocation module 158 may group thecomputational resources into multiple groups. For example, the CPUs maybe grouped in the first group, and the memory and storage devices may begrouped in the second group. The resource-allocation module 158 may thenselect a resource provider (e.g., the one that offers the lowest price)for each group of resources and allocate each group of the resourcesprovided by the selected provider to the serverless executionentity/container.

FIG. 7 is a flow chart illustrating an approach 700 for determiningsizes associated with computational resources and allocating the optimalavailable resources having the determined sizes to a serverlessexecution entity/container for executing a computing function inaccordance with various embodiments. In a first step 702, the revenueand expense monitoring module 154 may identify one or more computationalresources (e.g., a processor, a memory a storage I/O resource, a networkI/O resource and I/O pathways) associated with a serverless executionentity/container for executing one or more functions in an applicationin response to a user's request. In a second step 704, the revenue andexpense monitoring module 154 may determine and/or monitor the revenueand cost for allocating each of the computational resources to theserverless execution entity/container. In a third step 706, based on thedetermined/monitored revenue and expense, the function-sizing module 156may determine a size associated with each computational resourceallocated to the serverless execution entity/container for executing thecomputing function. Optionally, the resource-allocation module 158 mayidentify two or more resource providers for providing the necessarycomputational resources with the determined sizes to the serverlessexecution entity/container (step 708); each of the resource providersmay offer a purchase price. Based on the offered price, theresource-allocation module 158 may select a resource provider (e.g., theone offering the lowest price adjusted for capabilities such as speed,terms of service, reliability, or other cost-adjusting metric) (step710). Subsequently, the resource-allocation module 158 may allocate thecomputational resources, each having the determined size, from theselected resource provider to the serverless execution entity/container(step 712). The serverless execution entity/container may then executethe computing function as described above using the allocated resources(step 714).

Additionally or alternatively, the monitored revenue and/or expense maybe used to (i) scale up or down the serverless executionentity/container, by adding or removing resources to existing componentsin the serverless execution entity/container, (ii) scale up theserverless execution entity/container, by adding more serverlessexecution entities/containers, or (iii) suspend or terminate theserverless execution entity/container. For example, when the revenue andexpense monitoring module 154 determines that the ROI for a serverlessexecution entity/container exceeds a first upper predetermined threshold(e.g., 1), the resource-scaling module 160 may scale up the serverlessexecution entity/container. When the ROI exceeds a second upperpredetermined threshold (e.g., 3) larger than the first upper threshold,the resource-scaling module 160 may scale up the serverless executionentity/container by introducing an additional serverless executionentity/container. In contrast, when the revenue and expense monitoringmodule 154 determines that the ROI for a serverless executionentity/container is below a first lower predetermined threshold (e.g.,0.7), the resource-scaling module 160 may scale down the serverlessexecution entity/container. When the ROI is further below a second lowerpredetermined threshold (e.g., 0.3) smaller than the first lowerthreshold, the resource-scaling module 160 may suspend or terminate theserverless execution entity/container.

FIG. 8 is a flow chart illustrating an approach 800 for scaling up, downor out the serverless execution entity/container for executing acomputing function and/or terminating the serverless executionentity/container in accordance with various embodiments. In a first step802, the revenue and expense monitoring module 154 may identify one ormore computational resources (e.g., a processor, a memory a storage I/Oresource, a network I/O resource and I/O pathways) associated with aserverless execution entity/container for executing one or morefunctions in an application in response to a request. In a second step804, the revenue and expense monitoring module 154 may determine and/ormonitor the revenue and cost for allocating each of the computationalresources to the serverless execution entity/container. In a third step806, based on the monitored revenue and expense, the resource-scalingmodule 160 may scale up or down the serverless executionentity/container (e.g., by adding or removing resources to existingcomponents in the serverless execution entity/container) or scale up theserverless execution entity/container (e.g., by adding more serverlessexecution entities/containers). Alternatively, the resource-scalingmodule 160 may suspend or terminate the serverless executionentity/container when, for example, ROI for the serverless executionentity/container is below the predetermined threshold.

In general, the modules including the path-identifying module 146,information-acquisition module 148, path-selection module 150,recommendation module 152, revenue and expense monitoring module 154,function-sizing module 156, resource-allocation module 158, andresource-scaling module 160 described above may be implemented inhardware, software, or a combination of both, whether integrated withinthe CPU 132, or provided by a separate external processor or othercomputational entity or entities.

In addition, the manager system 120 may include one or more additionalmodules implemented in hardware, software, or a combination of both toperform functionality described above. For embodiments in which thefunctions are provided as one or more software programs, the programsmay be written in any of a number of high level languages such asPYTHON, FORTRAN, PASCAL, JAVA, C, C++, C#, BASIC, TENSORFLOW, THEANO,KERAS, PYTORCH, various scripting languages, and/or HTML. Additionally,the software can be implemented in an assembly language directed to themicroprocessor resident on a target computer; for example, the softwaremay be implemented in Intel 80×86 assembly language if it is configuredto run on an IBM PC or PC clone. The software may be embodied on anarticle of manufacture including, but not limited to, a floppy disk, ajump drive, a hard disk, an optical disk, a magnetic tape, a PROM, anEPROM, EEPROM, field-programmable gate array, or CD-ROM. Embodimentsusing hardware circuitry may be implemented using, for example, one ormore FPGA, CPLD or ASIC processors.

The terms and expressions employed herein are used as terms andexpressions of description and not of limitation, and there is nointention, in the use of such terms and expressions, of excluding anyequivalents of the features shown and described or portions thereof. Inaddition, having described certain embodiments of the invention, it willbe apparent to those of ordinary skill in the art that other embodimentsincorporating the concepts disclosed herein may be used withoutdeparting from the spirit and scope of the invention. Accordingly, thedescribed embodiments are to be considered in all respects as onlyillustrative and not restrictive.

The invention claimed is:
 1. A method of allocating computer resourcesto a serverless execution entity capable of executing at least onefunction thereon, the method comprising: (a) receiving a plurality ofrequests for execution of the at least one function, which requests donot specify and configure instances for execution of the at least onefunction; and (b) in response to each request, (i) determining acomputer resource bundle to be purchased for the serverless executionentity to execute the at least one function; (ii) identifying at leastfirst and second resource providers for providing the computer resourcebundle, each of the resource providers offering a purchase price to theserverless execution entity, the purchase price offered by the firstresource provider being smaller than that offered by the second resourceprovider; (iii) causing the serverless execution entity to purchase thecomputer resource bundle from the first resource provider; and (iv)causing the serverless execution entity to execute the at least onefunction on the purchased computer resource bundle.
 2. The method ofclaim 1, wherein the computer resource bundle comprises a plurality ofcomputational resources, and each of the at least first and secondresource providers offers a purchase price for allocating each of thecomputational resources to the serverless execution entity, the methodfurther comprising: automatically allocating a first one of thecomputational resources from the first resource provider to theserverless execution entity; and automatically allocating a second oneof the computational resources, different from the first one of thecomputational resources, from the second resource provider to theserverless execution entity, wherein the purchase price of the first oneof the computational resources offered by the first resource provider issmaller than that offered by the second resource provider and thepurchase price of the second one of the computational resources offeredby the second resource provider is smaller than that offered by thefirst resource provider.
 3. The method of claim 1, further comprisingdetermining at least one of a revenue or an expense for allocating thecomputer resource bundle to the serverless execution entity and based atleast in part on the determined revenue and/or expense, determining asize associated with the computer resource bundle, wherein the computerresource bundle to be purchased has the determined size.
 4. The methodof claim 3, wherein the revenue is generated by causing the at least onefunction to be executed on the serverless execution entity in responseto at least one of the requests, and the expense is generated byallocating the computer resource bundle to the serverless executionentity for executing the at least one function.
 5. The method of claim3, wherein the revenue is determined based at least in part on a unitprice associated with each resource in the computer resource bundle anda quantity of each resource in the computer resource bundle used toexecute the at least one function.
 6. The method of claim 3, furthercomprising upon determining that the revenue is larger than the expensefor a predetermined factor, increasing the size associated with thecomputer resource bundle.
 7. The method of claim 3, further comprisingupon determining that the revenue is smaller than the expense for apredetermined factor, decreasing the size associated with the computerresource bundle.
 8. The method of claim 3, wherein at least one of therevenue or the expense is computed over a predetermined period of time.9. The method of claim 1, wherein the computer resource bundle comprisea processor, a storage I/O resource, a network I/O resource and I/Opathways.
 10. The method of claim 1, wherein the at least one functioncomprises at least one of an AWS LAMBDA function, a Google cloudfunction, a Microsoft Azure function, an IBM OpenWhisk function, anOracle Cloud function, or a Kubernates-based Knative function.
 11. Acomputer system for allocating computer resources to a serverlessexecution entity capable of executing at least one function thereon, thecomputer system comprising a management system configured to: (a)receive a plurality of requests for execution of the at least onefunction, which requests do not specify and configure instances forexecution of the at least one function; and (b) in response to eachrequest, (i) determine a computer resource bundle to be purchased forthe serverless execution entity to execute the at least one function;(ii) identify at least first and second resource providers for providingthe computer resource bundle, each of the resource providers offering apurchase price to the serverless execution entity, the purchase priceoffered by the first resource provider being smaller than that offeredby the second resource provider; (iii) cause the serverless executionentity to purchase the computer resource bundle from the first resourceprovider; and (iv) cause the serverless execution entity to execute theat least one function on the purchased computer resource bundle.
 12. Thecomputer system of claim 11, wherein the computer resource bundlecomprises a plurality of computational resources, and each of the atleast first and second resource providers offers a purchase price forallocating each of the computational resources to the serverlessexecution entity, the management system being further configured to:automatically allocate a first one of the computational resources fromthe first resource provider to the serverless execution entity; andautomatically allocate a second one of the computational resources,different from the first one of the computational resources, from thesecond resource provider to the serverless execution entity, wherein thepurchase price of the first one of the computational resources offeredby the first resource provider is smaller than that offered by thesecond resource provider and the purchase price of the second one of thecomputational resources offered by the second resource provider issmaller than that offered by the first resource provider.
 13. Thecomputer system of claim 11, wherein the computer resource bundlecomprise a processor, a storage I/O resource, a network I/O resource andI/O pathways.
 14. The computer system of claim 11, wherein the at leastone function comprises at least one of an AWS LAMBDA function, a Googlecloud function, a Microsoft Azure function, an IBM OpenWhisk function,an Oracle Cloud function, or a Kubernates-based Knative function. 15.The computer system of claim 11, wherein the management system isfurther configured to determine at least one of a revenue or an expensefor allocating the computer resource bundle to the serverless executionentity and based at least in part on the determined revenue and/orexpense, determine a size associated with the computer resource bundle,wherein the computer resource bundle to be purchased has the determinedsize.
 16. The computer system of claim 15, wherein the revenue isgenerated by causing the at least one function to be executed on theserverless execution entity in response to at least one of the requests,and the expense is generated by allocating the computer resource bundleto the serverless execution entity for executing the at least onefunction.
 17. The computer system of claim 15, wherein the managementsystem is further configured to determine the revenue based at least inpart on a unit price associated with each resource in the computerresource bundle and a quantity of each resource in the computer resourcebundle used to execute the at least one function.
 18. The computersystem of claim 15, wherein the management system is further configuredto increase the size associated with the computer resource bundle upondetermining that the revenue is larger than the expense for apredetermined factor.
 19. The computer system of claim 15, wherein themanagement system is further configured to decrease the size associatedwith the computer resource bundle upon determining that the revenue issmaller than the expense for a predetermined factor.
 20. The computersystem of claim 15, wherein at least one of the revenue or the expenseis computed over a predetermined period of time.